package com.pxxy.yuyi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pxxy.yuyi.dao.OrderDao;
import com.pxxy.yuyi.entity.Order;
import com.pxxy.yuyi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by IntelliJ IDEA
 *
 * @Author : XuWen
 * @create 2021/6/20 15:57
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderDao orderDao;

    @Override
    public Integer insertOrder(Order order) {
        return orderDao.insertOrder(order);
    }

    @Override
    public PageInfo<Order> showOrder(Integer pageNum,String oname) {
        Order order=new Order();
        order.setOname(oname);
        PageHelper.startPage(pageNum,6);
        List<Order> list = orderDao.selectOrder(order);
        return new PageInfo<Order>(list);
    }

    @Override
    public Integer deleteOrder(Integer oid) {
        return orderDao.deleteOrder(oid);
    }



}
